<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>用户新增</title>
	<link href="__PUBLIC__/Css/manager.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="__PUBLIC__/Js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Components/ajaxFileUploader/ajaxfileupload.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Components/ueditor/editor_config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Components/ueditor/editor_all.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/Components/ueditor/themes/default/ueditor.css">
    <script type="text/javascript">
        $(document).ready(function(){
            var editor = new baidu.editor.ui.Editor({
                initialContent: "",
                minFrameHeight: 200,//初始化框架大小
                autoFloatEnabled: false,//工具栏自动浮动-》关闭
                textarea:'info'//form表单将通过该参数获得表单提交的数据
            });
            editor.render("info");
        });
    </script>
</head>
<body>

<h2>用户新增 <a href="__APP__/User/index" id="backBTN" >[取消返回]</a></h2>
<script type="text/javascript">
    $(document).ready(function(){
        $("#backBTN").click(function(){
            window.location.href="__APP__/User/index";
        });
    });

    function ajaxFileUpload()
    {
        $("#loading")
                .ajaxStart(function(){
                    $(this).show();
                })
                .ajaxComplete(function(){
                    $(this).hide();
                });

        $.ajaxFileUpload
                (
                        {
                            url:'__URL__/upload/random/'+Math.random(),
                            secureuri:true,
                            fileElementId:'faceimgFile',
                            dataType: 'json',
                            success: function (data, status)
                            {
                                if(status=="success"){
                                    if(data['status']==0){
                                        $("#faceimgShow").attr("src","__PUBLIC__/Uploads/faceimg/m_"+data["data"]);
                                        $("#faceimg").val(data["data"]);
                                        alert(data['info']);
                                    }else{
                                        alert(data["info"]);
                                    }
                                }
                            },
                            error: function (data, status, e)
                            {
                                alert(e);
                            }
                        }
                );

        return false;

    }
</script>
<form method='post' id="formList" action="__APP__/User/insert" enctype="multipart/form-data">
    <table id="user_Add" cellpadding=3 cellspacing=3>

        <tr>
            <td class="tRight" >用户名：</td>
            <td class="tLeft" ><input type="text" class="medium bLeftRequire"  id="account" name="username" ></td>
        </tr>
		<tr>
            <td class="tRight tTop">头  像：</td>
            <td class="tLeft">
                <img src="" alt="头像" id="faceimgShow">
                <input type="hidden" value="" name="faceimg" id="faceimg">
                <img src="__PUBLIC__/Components/ajaxFileUploader/loading.gif" id="loading" style="display: none;">
                <input type="file" name="faceimgFile" ID="faceimgFile"><input type="button" value="上&nbsp;&nbsp;&nbsp;传" onclick="return ajaxFileUpload();">
            </td>
        </tr>
        <tr>
            <td class="tRight" >密码：</td>
            <td class="tLeft" ><input type="password" class="medium bLeft" name="password" value=""></td>
        </tr>
        <tr>
            <td class="tRight" >昵称：</td>
            <td class="tLeft" ><input type="text" class="medium bLeft" name="nickname" value=""></td>
        </tr>
        <tr>
            <td class="tRight" >E-mail：</td>
            <td class="tLeft" ><input type="text"  class="medium bLeft" name="email"></td>
        </tr>
        <tr>
            <td class="tRight">状态：</td>
            <td class="tLeft"><SELECT class="small bLeft"  name="status">
                <option value="1">启用</option>
                <option value="0">禁用</option>
            </SELECT></td>
        </tr>
        <tr>
            <td class="tRight tTop">用户信息：</td>
            <td class="tLeft">
                <script type="text/plain" id="info" style="width:800px;"></script>
            </td>
        </tr>
        <tr>
            <td class="tRight tTop">备  注：</td>
            <td class="tLeft"><TEXTAREA class="large bLeft"  name="remark" rows="5" cols="57"></textarea></td>
        </tr>
        <tr>
            <td></td>
            <td class="center">
                <input type="submit" value="保 存" class="small submit">
                <input type="reset" class="submit  small" value="清 空" >
            </td>
        </tr>
    </table>
</form>


</body>
</html>